package slash.world;

import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import java.util.*;

import slash.entities.*;

public class CollisionLayer extends MapLayer{
	
	private ArrayList<CollisionBox> collisionBoxes;

	public CollisionLayer(){
		super();
		collisionBoxes = new ArrayList<CollisionBox>();
	}
	
	/**
	 * Adds collision box to layer
	 * @param box to add
	 */
	public void addCollisionBox(CollisionBox box){
		collisionBoxes.add(box);
	}
	
	/**
	 * Clears all boxes in layer
	 */
	public void clearCollisions(){
		collisionBoxes.clear();
	}
	
	@Override
	public void render(Graphics g) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void update(GameContainer container, int time) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public ArrayList<AbstractEntity> getObjects() {
		ArrayList<AbstractEntity> objects = new ArrayList<AbstractEntity>();
		for(int x=1;x<collisionBoxes.size();x++){
			AbstractEntity object = collisionBoxes.get(x);
			objects.add(object);
		}
		return objects;
	}

}
